<?php include DIR_MODULES . 'menu/menu_main_ctg_categories.php'; ?>

<table cellpadding="0" cellspacing="0" width="960px" border="0" align="center">
    <tr>
        <td id="coloana_dreapta_root_corp" valign="top">
        <!-- mijloc si dreapta //////////////////////////////////// -->
            <table cellpadding="0" cellspacing="0" width="100%" border="0">
                <tr>
                    <td id="content_corp" valign="top">
                    <!-- galerie media //////////////////////////////////////// -->
                    <?php include DIR_MODULES . 'galerie_header/index.php';?>
                    <!-- articole mijloc /////////////////////////////////////// -->
                            <div class="mijloc_root">
                            <?php
                                $y = 0;
                                echo '<br/><table cellpadding="0" cellspacing="0" border="0" width="620px">';
                                echo '<tr>';
                                $data = mysql_query("select * from dt_offers where c_id != '2' and c_id = '".$_GET['id']."' and o_active = '1' and o_random = '1' and show_in_head = '0' order by o_id desc");
                                $count=mysql_num_rows($data);
                                while ($row = mysql_fetch_array($data)){
                                    $y++;
                                    $imgs = $offersClass->picViewForOffer($row['o_id']);
                                    $img = mysql_fetch_array($imgs);
                                    $photos = mysql_query("select * from dt_offers_photos where o_id = '".$row['o_id']."'");
                                    $photoRow = mysql_fetch_array($photos);

                                    if($y == 2 || $y == 5 || $y == 8){echo '<td style="width:23px;">&nbsp;</td>';}
                                    echo '<td style="width:190px;">';
                                    echo '<div class="cornerholder"><!-- corner holder root -->';
                                    echo '<div class="whitecorner"><img src="../../templates/default/images/corner-stanga-sus-16x16.png" width="16" height="16" alt="" /><!-- corner placeholder -->';
                                    echo'</div><!-- end corner placeholder -->';
                                    echo '<div class="mosaic-block bar">
                                                <a href="../../offers/'.$row['c_id'].'/'.$row['o_id'].'/'.cleanitup($row['o_title']).'.html" class="mosaic-overlay">
                                                        <div class="mosaic-details">
                                                        <div class="mosaic-details-bgcolor">&nbsp;</div>
                                                        <div class="mosaic-details-textcolor">
                                                                <div class="mosaic-details-title">'.$row['o_title'].' '.$row['o_label'].'</div>
                                                                <div class="mosaic-details-content">'.limitclear($row['o_small_desc'], 150).'...'.'</div>
                                                                    <div class="mosaic-details-maimult">Mai mult&nbsp;<img src="../../templates/default/images/more-white.png" alt="" /></div>
                                                        </div>
                                                        </div>
                                                </a>
                                                <div class="mosaic-backdrop">
                                                <img src="../../uploads/offers/img/'.cleanitup($row['o_title']).'/thumbs/thumb-230_'.$img['oImg_file'].'"/>
                                                </div>
                                        </div>';
                                    echo '</div><!-- end corner holder root -->';
                                    echo '</td>';
                                    if($y == 2 || $y == 5 || $y == 8){echo '<td style="width:23px;">&nbsp;</td>';}
                                    if($y == 3 || $y == 6){echo '</tr><tr><td colspan="5" style="height:25px;">&nbsp;</td></tr><tr>';}

                                }
                                echo '</tr>';
                                echo '</table><div style="height:20px;">&nbsp;</div>';
                            ?>

                            <table style="border-top:3px #e6e6e6 solid;padding-top:10px;padding-bottom:10px;" cellpadding="0" cellspacing="0" border="0" width="620px">

                            <?php
                            $data = mysql_query("select * from dt_offers where c_id != '2' and c_id = '".$_GET['id']."' and o_active = '1' and o_random = '0' and show_in_head = '0' order by o_id desc limit 0, 2");
                            while ($row = mysql_fetch_array($data)){
                                $imgs = $offersClass->picViewForOffer($row['o_id']);
                                $img = mysql_fetch_array($imgs);
                                $photos = mysql_query("select * from dt_offers_photos where o_id = '".$row['o_id']."'");
                                $photoRow = mysql_fetch_array($photos);

                                //echo '<table style="border-top:3px #e6e6e6 solid;padding-top:10px;padding-bottom:10px;" cellpadding="0" cellspacing="0" border="0" width="620px">';

                                echo '<tr>';
                                if ($row['o_price'] == '')
                                    echo '<td class="articol_corp_modul" valign="top">';
                                else
                                    echo '<td class="articol_corp_modul" valign="top">';

                                echo '<div class="articol_corp_titlu"><a class="link_vaca" href="../../offers/'.$row['c_id'].'/'.$row['o_id'].'/'.cleanitup($row['o_title']).'.html">'.$row['o_title'].'</a> <b><a href="../../offers/'.$row['c_id'].'/'.$row['o_id'].'/'.cleanitup($row['o_title']).'.html">'.$row['o_label'].'</a></b></div>';
                                echo '<div class="articol_corp_text" style="padding-bottom:15px">';
                                echo '<a class="link_vaca" href="../../offers/'.$row['c_id'].'/'.$row['o_id'].'/'.cleanitup($row['o_title']).'.html">'.limitclear($row['o_small_desc'], 250).'...</a>';
                                echo '</div>';
                                echo '</td>';

                                if ($row['o_price'] != ''){
                                    echo '<td width="65" valign="top">';
                                    echo '<div class="OS_price_leisure"><div class="OSPL1">'.$row['o_price'].'</div><div class="OSPL2">'.$row['o_price_type'].'</div></div>';
                                    echo '</td>';
                                }
                                echo '</tr>';
                                echo '<tr><td colspan="2"><div class="mijloc_hr">&nbsp;</div></td></tr>';
                            }
                            echo '</table>';
                            ?>
                            </div>
                    <!-- end articole mijloc /////////////////////////////////// -->
                    </td>
                    <td class="coloana_separator" valign="top">&nbsp;</td>
                    <?php
                        $cDreapta = mysql_query("select * from dt_mod_visible
                                        where z_id = '2'
                                        and visible = '1'
                                        and c_id = '".$_GET['id']."'
                                        order by `order`");
                        //daca nu exista nici un rezultat atunci ascunde coloana
                        if (mysql_num_rows($cDreapta)>0){
                    ?>
                    <td id="content_dreapta" valign="top">
                    <!-- content dreapta ////////////////////////////////////// -->
                    <?php include DIR_MODULES . 'coloane_module/coloana_dreapta.php'; ?>
                    <!-- end content dreapta ////////////////////////////////// -->
                    </td>
                    <?php }?>
                </tr>
            </table>
        <!-- end mijloc si dreapta //////////////////////////////// -->
        </td>
    </tr>
</table>